import java.awt.*;

public class Map {
    public static int[][] map;
    public static void initMap(){
        map = new int[Setting.WIDTH_NUM + 1][Setting.HEIGHT_NUM + 1];
    }
    public static void clearMap(){
        for (int i = 0; i <= Setting.WIDTH_NUM; i++) {
            for (int j = 0; j <= Setting.HEIGHT_NUM; j++) {
                map[i][j] = 0;
            }
        }
//        System.out.println("初始化完成" + map[3][3]);
    }
//    格式化地图
    public static void formatMap(Snake snakes, Ponit food){
        Snake snake = snakes;
        clearMap();
        int x = 0;
        int y = 0;
        x = snake.list.get(0).getX();
        y = snake.list.get(0).getY();
        map[x][y] = 2;
        map[food.getX()][food.getY()] = 3;
        for(int i = 1; i < snake.list.size(); i++){
            x = snake.list.get(i).getX();
            y = snake.list.get(i).getY();
            map[x][y] = 1;
        }
    }
}
